<template>
    <div>
        <el-input v-model="tableName"></el-input>
        <el-button @click="addTable">点击添加桌台</el-button>
    </div>
</template>


<script>
export default {
    data(){
        return{
            tableName:''
        }
    },
    methods:{
        addTable(){
            //添加桌台
            let url = this.$store.state.globalSettings.apiUrl+'/tables';
            let data = {
                tname:this.tableName,
                status:0 //默认状态为0 空闲
            }
            this.axios.post(url,data).then(res=>{
               if(res.data.code==200){
                   alert('添加成功')
               }
            })
        }
    }
}
</script>